package com.zygame.sdk.utils;

import android.content.Context;

import com.zygame.sdk.bean.UserBean;
import com.zygame.sdk.db.UserDao;
import com.zygame.sdk.model.UserModel;
import com.zygame.sdk.utils.log.LogHelper;

import org.json.JSONObject;

public class LoginUtil {
    private static String TAG = "LoginUtil";

    public static void loginResult(String account, String pwd, JSONObject paramObject, Context context, String type, int updata,String other) {
        LogHelper.e(TAG, "login callback Result = " + paramObject.toString());
        UserModel.getInstance().setUserModel(paramObject.toString());
        SharedPreferencesHelper.getInstance().setLogin_Token(context, paramObject.optString("login_token"));
        if (updata == 1) {
            UserBean ub = new UserBean(account, pwd, type,other,"1");
            new UserDao().addToDb(ub);
        }
    }
}
